/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('alicloudproc', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model BillingCenterICommandServiceProcessMessageRequest {
  data?: string(name='data'),
}

model BillingCenterICommandServiceProcessMessageResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model BillingCenterICommandServiceProcessMessageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BillingCenterICommandServiceProcessMessageResponseBody(name='body'),
}

async function billingCenterICommandServiceProcessMessageWithOptions(request: BillingCenterICommandServiceProcessMessageRequest, runtime: Util.RuntimeOptions): BillingCenterICommandServiceProcessMessageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BillingCenterICommandServiceProcessMessage',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function billingCenterICommandServiceProcessMessage(request: BillingCenterICommandServiceProcessMessageRequest): BillingCenterICommandServiceProcessMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return billingCenterICommandServiceProcessMessageWithOptions(request, runtime);
}

model BillingCenterIVerifyServiceVerifyOrderRequest {
  data?: string(name='data'),
}

model BillingCenterIVerifyServiceVerifyOrderResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model BillingCenterIVerifyServiceVerifyOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BillingCenterIVerifyServiceVerifyOrderResponseBody(name='body'),
}

async function billingCenterIVerifyServiceVerifyOrderWithOptions(request: BillingCenterIVerifyServiceVerifyOrderRequest, runtime: Util.RuntimeOptions): BillingCenterIVerifyServiceVerifyOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BillingCenterIVerifyServiceVerifyOrder',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function billingCenterIVerifyServiceVerifyOrder(request: BillingCenterIVerifyServiceVerifyOrderRequest): BillingCenterIVerifyServiceVerifyOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return billingCenterIVerifyServiceVerifyOrderWithOptions(request, runtime);
}

model BillingCommissionCanRefundRequest {
  data?: string(name='data'),
}

model BillingCommissionCanRefundResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model BillingCommissionCanRefundResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BillingCommissionCanRefundResponseBody(name='body'),
}

async function billingCommissionCanRefundWithOptions(request: BillingCommissionCanRefundRequest, runtime: Util.RuntimeOptions): BillingCommissionCanRefundResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BillingCommissionCanRefund',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function billingCommissionCanRefund(request: BillingCommissionCanRefundRequest): BillingCommissionCanRefundResponse {
  var runtime = new Util.RuntimeOptions{};
  return billingCommissionCanRefundWithOptions(request, runtime);
}

model BillingCommissionPayOrderCallbackRequest {
  data?: string(name='data'),
}

model BillingCommissionPayOrderCallbackResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model BillingCommissionPayOrderCallbackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BillingCommissionPayOrderCallbackResponseBody(name='body'),
}

async function billingCommissionPayOrderCallbackWithOptions(request: BillingCommissionPayOrderCallbackRequest, runtime: Util.RuntimeOptions): BillingCommissionPayOrderCallbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BillingCommissionPayOrderCallback',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function billingCommissionPayOrderCallback(request: BillingCommissionPayOrderCallbackRequest): BillingCommissionPayOrderCallbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return billingCommissionPayOrderCallbackWithOptions(request, runtime);
}

model BillingCommissionRefundRequest {
  data?: string(name='data'),
}

model BillingCommissionRefundResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model BillingCommissionRefundResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BillingCommissionRefundResponseBody(name='body'),
}

async function billingCommissionRefundWithOptions(request: BillingCommissionRefundRequest, runtime: Util.RuntimeOptions): BillingCommissionRefundResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BillingCommissionRefund',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function billingCommissionRefund(request: BillingCommissionRefundRequest): BillingCommissionRefundResponse {
  var runtime = new Util.RuntimeOptions{};
  return billingCommissionRefundWithOptions(request, runtime);
}

model MemberOrderPaidCallBackRequest {
  data?: string(name='data'),
}

model MemberOrderPaidCallBackResponseBody = {
  requestId?: string(name='RequestId'),
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model MemberOrderPaidCallBackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MemberOrderPaidCallBackResponseBody(name='body'),
}

async function memberOrderPaidCallBackWithOptions(request: MemberOrderPaidCallBackRequest, runtime: Util.RuntimeOptions): MemberOrderPaidCallBackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MemberOrderPaidCallBack',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function memberOrderPaidCallBack(request: MemberOrderPaidCallBackRequest): MemberOrderPaidCallBackResponse {
  var runtime = new Util.RuntimeOptions{};
  return memberOrderPaidCallBackWithOptions(request, runtime);
}

model MemberOrderRefundRequest {
  data?: string(name='data'),
}

model MemberOrderRefundResponseBody = {
  requestId?: string(name='RequestId'),
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  success?: string(name='success'),
  synchro?: string(name='synchro'),
}

model MemberOrderRefundResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MemberOrderRefundResponseBody(name='body'),
}

async function memberOrderRefundWithOptions(request: MemberOrderRefundRequest, runtime: Util.RuntimeOptions): MemberOrderRefundResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MemberOrderRefund',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function memberOrderRefund(request: MemberOrderRefundRequest): MemberOrderRefundResponse {
  var runtime = new Util.RuntimeOptions{};
  return memberOrderRefundWithOptions(request, runtime);
}

model MemberOrderVerifyRequest {
  data?: string(name='data'),
}

model MemberOrderVerifyResponseBody = {
  requestId?: string(name='RequestId'),
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model MemberOrderVerifyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MemberOrderVerifyResponseBody(name='body'),
}

async function memberOrderVerifyWithOptions(request: MemberOrderVerifyRequest, runtime: Util.RuntimeOptions): MemberOrderVerifyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MemberOrderVerify',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function memberOrderVerify(request: MemberOrderVerifyRequest): MemberOrderVerifyResponse {
  var runtime = new Util.RuntimeOptions{};
  return memberOrderVerifyWithOptions(request, runtime);
}

model SupplierOrderLifeRequest {
  data?: string(name='data'),
}

model SupplierOrderLifeResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model SupplierOrderLifeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SupplierOrderLifeResponseBody(name='body'),
}

async function supplierOrderLifeWithOptions(request: SupplierOrderLifeRequest, runtime: Util.RuntimeOptions): SupplierOrderLifeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SupplierOrderLife',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function supplierOrderLife(request: SupplierOrderLifeRequest): SupplierOrderLifeResponse {
  var runtime = new Util.RuntimeOptions{};
  return supplierOrderLifeWithOptions(request, runtime);
}

model SupplierOrderProduceRequest {
  data?: string(name='data'),
}

model SupplierOrderProduceResponseBody = {
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model SupplierOrderProduceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SupplierOrderProduceResponseBody(name='body'),
}

async function supplierOrderProduceWithOptions(request: SupplierOrderProduceRequest, runtime: Util.RuntimeOptions): SupplierOrderProduceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SupplierOrderProduce',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function supplierOrderProduce(request: SupplierOrderProduceRequest): SupplierOrderProduceResponse {
  var runtime = new Util.RuntimeOptions{};
  return supplierOrderProduceWithOptions(request, runtime);
}

model SupplierOrderVerifyRequest {
  data?: string(name='data'),
}

model SupplierOrderVerifyResponseBody = {
  requestId?: string(name='RequestId'),
  code?: string(name='code'),
  data?: string(name='data'),
  message?: string(name='message'),
  success?: boolean(name='success'),
  synchro?: string(name='synchro'),
}

model SupplierOrderVerifyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SupplierOrderVerifyResponseBody(name='body'),
}

async function supplierOrderVerifyWithOptions(request: SupplierOrderVerifyRequest, runtime: Util.RuntimeOptions): SupplierOrderVerifyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.data)) {
    query['data'] = request.data;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SupplierOrderVerify',
    version = '2021-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function supplierOrderVerify(request: SupplierOrderVerifyRequest): SupplierOrderVerifyResponse {
  var runtime = new Util.RuntimeOptions{};
  return supplierOrderVerifyWithOptions(request, runtime);
}

